package muduo.Datas {
	import com.netease.protobuf.*;
	import flash.utils.Endian;
	import flash.utils.IDataInput;
	import flash.utils.IExternalizable;
	import flash.errors.IOError;
	// @@protoc_insertion_point(imports)

	// @@protoc_insertion_point(class_metadata)
	public final class Data extends com.netease.protobuf.Message implements flash.utils.IExternalizable {
		public var k:String;

		public var v:String;

		/**
		 *  @private
		 */
		override public final function writeToBuffer(output:WritingBuffer):void {
			WriteUtils.writeTag(output, WireType.LENGTH_DELIMITED, 1);
			WriteUtils.write$TYPE_STRING(output, k);
			WriteUtils.writeTag(output, WireType.LENGTH_DELIMITED, 2);
			WriteUtils.write$TYPE_STRING(output, v);
		}

		/**
		 *  @private
		 */
		override public final function readFromSlice(input:IDataInput, bytesAfterSlice:uint):void {
			var k$count:uint = 0;
			var v$count:uint = 0;
			while (input.bytesAvailable > bytesAfterSlice) {
				var tag:uint = ReadUtils.read$TYPE_UINT32(input);
				switch (tag >>> 3) {
				case 1:
					if (k$count != 0) {
						throw new IOError('Bad data format: Data.k cannot be set twice.');
					}
					++k$count;
					k = ReadUtils.read$TYPE_STRING(input);
					break;
				case 2:
					if (v$count != 0) {
						throw new IOError('Bad data format: Data.v cannot be set twice.');
					}
					++v$count;
					v = ReadUtils.read$TYPE_STRING(input);
					break;
				default:
					ReadUtils.skip(input, tag & 7);
				}
			}
			if (k$count != 1) {
				throw new IOError('Bad data format: Data.k must be set.');
			}
			if (v$count != 1) {
				throw new IOError('Bad data format: Data.v must be set.');
			}
		}

	}
}
